package com.animations;

import com.beans.BirdBean;
import com.beans.ButtonEvent;
import com.beans.ListBean;
import creator.ui.graphics.Magicanvas;
import java.awt.Graphics;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

public class ListAction2 extends ListAction {

  public void paintList(Graphics g) {
    if (!BirdBean._isAlive()) paintList1(g);
  }

  public void LoadMouseListener(Magicanvas magicanvas) {
    magicanvas.addMouseListener(
      new MouseAdapter() {
        public void mousePressed(MouseEvent e) {
          if (
            (e.getX() > ListAction2.this.list.getListX()) &&
            (!BirdBean._isAlive()) &&
            (
              e.getX() <
              ListAction2.this.list.getListX() +
              ListAction2.this.list.getListW()
            ) &&
            (e.getY() > ListAction2.this.list.getListY()) &&
            (
              e.getY() <
              ListAction2.this.list.getListY() +
              ListAction2.this.list.getListH()
            )
          ) ListAction2.this.list.setListY(
              ListAction2.this.list.getListOldY() + 3
            );
        }

        public void mouseReleased(MouseEvent e) {
          if (
            (e.getX() > ListAction2.this.list.getListX()) &&
            (!BirdBean._isAlive()) &&
            (
              e.getX() <
              ListAction2.this.list.getListX() +
              ListAction2.this.list.getListW()
            ) &&
            (e.getY() > ListAction2.this.list.getListY()) &&
            (
              e.getY() <
              ListAction2.this.list.getListY() +
              ListAction2.this.list.getListH()
            )
          ) {
            ListAction2.this.list.setListY(ListAction2.this.list.getListOldY());
            ButtonEvent.sendMassage("-> Clicked List");
            ListAction2.this.isDisplay = true;
            ListAction2.this.getMagicanvas().repaint();
          } else {
            ListAction2.this.isDisplay = false;
            ListAction2.this.getMagicanvas().repaint();
          }
        }
      }
    );
  }
}
